/*
 * @Description: 新增工单
 * @Version: V1.0.0
 * @Autor: CHY
 * @Date: 2022-04-02 10:31:16
 * @LastEditors: CHY
 * @LastEditTime: 2022-04-08 22:28:33
 */
import React, { useState } from 'react';
import { Modal } from 'antd';
import PubSub from 'pubsub-js';

import Search from './search'
import AddTable from './selectTable'
import './index.css'
import '../../modal.css'
const Index = () => {
    const [isModalVisible, setIsModalVisible] = useState(false);


    const handleOk = (e) => {
        setIsModalVisible(false);
        e.stopPropagation()
    };

    const handleCancel = (e) => {
        setIsModalVisible(false);
        e.stopPropagation()
        // console.log("@@@@");
    };

    PubSub.subscribe('newAddOrder', setIsModalVisible)

    return (
        <div className='newAddOrder-container'>
            <Modal title="新增工单【第一步：选择客服名称】" visible={isModalVisible} onOk={handleOk} onCancel={handleCancel} className='newAddOrder-box newAddOrder-modal' cancelText='取消' okText='确定'>
                <div className='newAddOrder-content'>
                    {/* 收索 */}
                    <div className='newAddOrder-search'><Search /> </div>
                    <div className='newAddOrder-guide'>1单击选中客户&gt;&gt;2录入信息</div>
                    <div className='newAddOrder-other-client'>无关联客户点击处</div>
                    <div><AddTable /></div>
                </div>
            </Modal>
        </div>
    )
}

export default Index;

